from random import randint
import plotly.express as px


class Die:
    def __init__(self, num_sides=6):
        self.num_sides = num_sides

    def roll(self):
        return randint(1, self.num_sides)


die1 = Die(8)
die2 = Die(8)

results = []
for num in range(100):
    result = die1.roll() + die2.roll()
    results.append(result)

max_results = die1.num_sides + die2.num_sides
poss_result = range(2, max_results + 1)
frequencies = []
for value in poss_result:
    frequencies.append(results.count(value))

title = 'result of rolling'

labels = {
    'x': 'Result',
    'y': 'Result of Frequency'
}

fig = px.bar(x=poss_result, y=frequencies, title=title, labels=labels)
fig.show()
